module.exports = function (app,svgCaptcha) {
  app.get("/captcha", function (req, res) {
    var codeConfig = {
      size: 4, // 验证码长度
      ignoreChars: "0o1ilL", // 验证码字符中排除 0o1ilL
      noise: 2, // 干扰线条的数量
      height: 60
    };
    var captcha = svgCaptcha.create(codeConfig);
    var text = captcha.text.toLowerCase();

    //存session用于验证接口获取文字码
    // req.session.captcha = captcha.text.toLowerCase();
    res.json({
      img: captcha.data,
      text: text
    });
    return
  });
}
